<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePaymentOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('payment_orders', function (Blueprint $table) {
            $table->increments('id');
            $table->string('product_name')->comment('订单产品名称');
            $table->decimal('procuct_price', 8, 2)->comment('订单产品价格');
            $table->decimal('order_price', 8, 2)->comment('订单价格');
            $table->integer('status')->comment('订单状态 1 未付款，2 已支付， 3 已失效');
            $table->dateTime('payment_time')->comment('支付时间')->nullable();
            $table->string('user_id')->comment('用户编号');
            $table->string('trxid')->comment('第三方支付单号')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('payment_orders');
    }
}
